import { _decorator, Component, Node } from 'cc';
import { BaseViewCmpt } from '../../Frame/Script/Base/baseViewCmpt';
import { App } from '../app';
import { NetInfo } from '../core/NetInfo';
const { ccclass, property } = _decorator;

@ccclass('LeaveViewManager')
export class LeaveViewManager extends BaseViewCmpt {


    protected onLoad(): void {
        super.onLoad();
    }

    start() {

    }

    update(deltaTime: number) {

    }

    async onClick_btnLeave() {
        this.onClick_closeBtn();
        App.user.updateUserInfo({ seatId: 0 });
        await App.ws.callApi("game/LeaveSeat", { session: NetInfo.session });
    }

    onClick_btnCancel() {
        this.onClick_closeBtn();
    }

    onClick_btnClose() {
        this.onClick_closeBtn();
    }
}


